# 3.11 Pressure Sensor ## 3.11.1 Overview BMP388 pressure sensor is a pneumatic MEMS sensor a very compact package, featuring small size, low power consumption but high performance. In brief, it is a combination of the temperature and pressure sensor, which is perfect for mobile applications. This module adopts proven piezoresistive pressure sensing technology with high accuracy and linearity, as well as long-term stability and high EMC stability. Besides, it maximize flexibility in multi-device working, and is ideal for altitude tracking in consumer electronics drones, wearables, smart homes, etc. As for improvement, we can optimize the device in terms of power consumption, resolution and filtering performance. ## 3.11.2 Schematic Diagram ![t107](./media/t107.png) Based on piezoelectric pressure sensing technology, the BMP388 pressure sensor accurately measures pressure and temperature. It is capable of measuring air pressure in the 300 ~ 1250 hPa range without consuming much power (consuming only 3.4 µA at 1 Hz operating frequency). In addition, the built-in infinite impulse response filter can effectively reduce effects from external interference. ## 3.11.3 Code Blocks Blocks in ![](./media/codingBox.png): 1. ![t191](./media/t191.png) is a block included in coding box library. It reads the air pressure values sensed by the pressure sensor in the coding box. ## 3.11.4 Test Code You can manually build blocks, or directly open the code file we provide: `3-11-Pressure.ubp`. If you have any questions about how to open code files or upload code, please back to `1.9 Upload Code`. **Build code blocks:** 1. In ![](./media/control.png), drag ![](./media/t1.png) and ![](./media/t2.png) to the script area, and stack them together. ![t34](./media/t34.png) 2. In ![](./media/output.png), drag ![t44](./media/t44.png) block and place in ![](./media/t2.png). 3. In ![](./media/codingBox.png), drag ![t191](./media/t191.png) block and put it in ![t44](./media/t44.png). 4. In ![](./media/control.png), drag ![t4](./media/t4.png) and set the delay to `200ms`. **Complete code:** ![t192](./media/t192.png) ## 3.11.5 Test Result Connect the coding box to the MicroBlocks via USB or Bluetooth, and click ![t59](./media/t59.png) to upload the code to the coding box. You will see the ambient air pressure value sensed by the sensor. ![t193](./media/t193.png)